<?php /* Smarty version 2.6.20, created on 2016-07-19 18:19:59
         compiled from hp_order.htm */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'hp_order.htm', 105, false),array('modifier', 'number_format', 'hp_order.htm', 142, false),array('modifier', 'default', 'hp_order.htm', 299, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>伙拼订单</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script language="javascript" src="../script/Calendar.js"></script>
<script type="text/javascript">
$(function(){
	$('.search').bind("mouseenter", function (e) {
		$(this).addClass("hover");
	}).bind("mouseleave", function (e) {
		//$(this).removeClass("hover");
	});
	$('.close').bind("click", function (e) {
		$(this).parent().parent().removeClass("hover");
	});
	
	$('#stime,#p_stime,#s_stime').click(function () {
	var left = $("#Calendar").css("left");
	left = left.substring(0,left.length-2);
	left = left - 359;
	left = left+"px";
	var top = $("#Calendar").css("top");
	top = top.substring(0,top.length-2);
	top = top - 90;
	top = top+"px";
	$("#Calendar").css("left",left);
	$("#Calendar").css("top",top);
});
$('#etime,#p_etime,#s_etime').click(function () {
	var left = $("#Calendar").css("left");
	left = left.substring(0,left.length-2);
	left = left - 359;
	left = left+"px";
	var top = $("#Calendar").css("top");
	top = top.substring(0,top.length-2);
	top = top - 90;
	top = top+"px";
	$("#Calendar").css("left",left);
	$("#Calendar").css("top",top);
});

$(".a-opear").live('click',function(){
    
    var data = $(this).attr('data-param');
    eval("data = "+data);
    var type = $(this).attr('data-type');
    if(!data.order_id)
    {
        error('error','对不起，请选择订单后操作！');
        return false;
    }
    
    window.parent.ajax_form("hp_order", "操作售后申请", '<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&act=opear&type='+type+'&orderId='+data.order_id, 800);
    return false;
    
});
});

//显示总销售额
function showSellAmount(cond){
	$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=huopin&s=order.php',{"act":"getSellAmountByCond","cond":''+cond+''},function(s){
		window.parent.html_form('sellAmount','总销售额',s,800,300);
	});
}
</script>
</head>
<body>
	<div class="container">
        <div class="flow">
            <div class="itemtitle">
                <h3>伙拼订单</h3>
                <ul>
                    <li <?php if ($_GET['operation'] == '' && $_GET['type'] === ''): ?>class="current"<?php endif; ?>><a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
"><span>管理</span></a></li>
                    
                    <li <?php if ($_GET['type'] == '1'): ?>class="current"<?php endif; ?>><a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&type=1"><span>未支付</span></a></li>
                    <li <?php if ($_GET['type'] == '2'): ?>class="current"<?php endif; ?>><a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&type=2"><span>已支付</span></a></li>
                    <li <?php if ($_GET['type'] == '0'): ?>class="current"<?php endif; ?>><a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&type=0"><span>已取消</span></a></li>
                    
                    <?php if ($_GET['operation'] == 'edit'): ?>
                    <li class="current"><a href="#"><span>操作</span></a></li>
                    <?php endif; ?>
                </ul>
            </div>
        </div>
        <div class="h35"></div>  
        <?php if ($_GET['operation'] == 'edit'): ?>
            <table class="table">
                <thead>
                    <tr>
                        <th class="partition" colspan="99">订单详情</th>
                    </tr>
                </thead>
                <tbody>
                <tr class="tr">
                    <td width="50">订单状态</td>
                    <td width="50"><b class="org"><?php $this->assign('val', $this->_tpl_vars['de']['status']); ?><?php echo $this->_tpl_vars['statu_list'][$this->_tpl_vars['val']]; ?>
</b></td>
                
                    <td width="50">订单编号</td>
                    <td width="50"><?php echo $this->_tpl_vars['de']['order_id']; ?>
</td>
                    
                    <td width="50">下单时间</td>
                    <td width="100"><?php echo ((is_array($_tmp=$this->_tpl_vars['de']['create_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
</td>
                </tr>
                <tr>
                    <?php if ($this->_tpl_vars['de']['pay_time'] > 0): ?>
                    <td width="50">付款时间</td>
                    <td width="100"><?php echo ((is_array($_tmp=$this->_tpl_vars['de']['pay_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
</td>
                    
                    <td width="50">支付方式</td>
            		<td><?php echo $this->_tpl_vars['de']['payment_name']; ?>
</td>
                    <?php endif; ?>
                    
                    <td width="50">订单金额</td>
                    <td width="100"><?php echo $this->_tpl_vars['config']['money']; ?>
<b class="red"><?php echo $this->_tpl_vars['de']['total_price']; ?>
</b></td>
                    
                    <td width="50">备注</td>
                    <td width="100"><?php echo $this->_tpl_vars['de']['admin_remark']; ?>
</td>
                </tr>
                </tbody>
            </table>
            <table class="table">    
                <thead>
                    <tr>
                        <th class="partition" colspan="99">订单商品信息</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                    	<td></td>
                        <td>产品名称</td>
                        <td width="150">单价（元）</td>
                        <td width="150">数量</td>
                        <td width="300">总价（元）</td>
                    </tr>
                    <?php $_from = $this->_tpl_vars['productList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                    <tr>
                        <td width="90"><a target="_blank" href="<?php echo $this->_tpl_vars['list']['pic']; ?>
"><img width="80" src="<?php echo $this->_tpl_vars['list']['pic']; ?>
"></a></td>
                        <td><?php echo $this->_tpl_vars['list']['product_name']; ?>
</td>
                        <td>&nbsp;<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td>
                        <td>&nbsp;<?php echo $this->_tpl_vars['list']['num']; ?>
</td>
                        <td>&nbsp;<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['price']*$this->_tpl_vars['list']['num'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td>
                    </tr>
                    <?php endforeach; endif; unset($_from); ?>
                </tbody>
            </table>
            <?php if ($this->_tpl_vars['de']['status'] != 0): ?>
            <form name="form1" id="form1" method="post">
            <input name="m" type="hidden" value="<?php echo $_GET['m']; ?>
">
            <input name="s" type="hidden" value="<?php echo $_GET['s']; ?>
">
            <input name="id" type="hidden" id="id" value="<?php echo $this->_tpl_vars['de']['id']; ?>
">
            <table class="table">
            	<thead>
                    <tr>
                        <th class="partition" colspan="99">取消订单</th>
                    </tr>
                </thead>
                <tbody>
                <tr>
                    <td width="100" valign="top"><div class="mt10">取消缘由</div></td>
                    <td>
                    <ul class="cancel">
                        <li>
                            <input type="radio" value="无法备齐货物" id="d1" name="admin_remark" checked="">
                            <label for="d1">无法备齐货物</label>
                        </li>
                        <li>
                            <input type="radio" value="不是有效的订单" id="d2" name="admin_remark">
                            <label for="d2">不是有效的订单</label>
                        </li>
                        <li>
                            <input type="radio" value="买家主动要求" id="d3" name="admin_remark">
                            <label for="d3">买家主动要求</label>
                        </li>
                        <li>
                            <input type="radio" value="其他原因" id="d4" flag="other_reason" name="admin_remark">
                            <label for="d4">其他原因</label>
                        </li>
                        <li style="display:none; height:48px;" id="other_reason">
                        	<textarea class="w300" rows="2" name="other_reason"></textarea>
                        </li>
                    </ul>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                    <input class="submit" onclick="return confirm('您确实要取消该订单吗');" type="submit" value="取消订单">
                    <input name="act" type="hidden" id="action" value="cancel">
                    </td>
                </tr>
                </tbody>
			</table>
            </form>
            <script type="text/javascript">
			$(function(){
				$("input[name='admin_remark']").click(function(){
					if ($(this).attr('flag') == 'other_reason')
					{
						$('#other_reason').show();
					}
					else
					{
						$('#other_reason').hide();
					}
				});
			});
			</script> 
            <?php endif; ?>
        <?php else: ?>
        <table class="select_table">
        <tr>    
            <td>
            	<div class="select_box">
                <form action="" method="get">
                    <input type="hidden" name="m" value="<?php echo $_GET['m']; ?>
">
                    <input type="hidden" name="s" value="order.php">
                    <input type="hidden" name="status" value="<?php echo $_GET['status']; ?>
">
										<select name="stock_shop" id="stock_shop" style="float:left;">
                <option value="" <?php if ($this->_tpl_vars['general_shop'] != 0): ?>disabled<?php endif; ?>>全部</option>
                <?php $_from = $this->_tpl_vars['stock_shops']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                <option value="<?php echo $this->_tpl_vars['list']['id']; ?>
" <?php if ($_GET['stock_shop'] == $this->_tpl_vars['list']['id']): ?>selected<?php endif; ?> <?php if ($this->_tpl_vars['general_shop'] != 0 && $this->_tpl_vars['general_shop'] != $this->_tpl_vars['list']['id']): ?>disabled<?php endif; ?>><?php echo $this->_tpl_vars['list']['title']; ?>
</option>
                
                <?php endforeach; endif; unset($_from); ?>
                </select>
                    <input placeholder="请输入订单编号..." type="text" name="code" class="txt w250" value="<?php echo $_GET['code']; ?>
" />
                    <input type="submit" value="搜索" />
                </form>
                </div>
                <div class="search">
                	<a class="a-search" href="#">高级搜索</a>
                	<div class="div-search">
                        <div class="close"></div>
                        <div class="line"></div>
                        <div class="search-con clearfix">
                        <form action="" method="get">
                        <input type="hidden" name="m" value="<?php echo $_GET['m']; ?>
">
                        <input type="hidden" name="s" value="order.php">
                        <input type="hidden" name="type" value="<?php echo $_GET['type']; ?>
">
                        <dl>
                            <dt>订单编号</dt>
                            <dd><input type="text" class="w250" name="code" value="<?php echo $_GET['code']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>伙拼状态</dt>
                            <dd>
                            <select name="hp_status" class="w250">
                            <option value="">--全部--</option>
	                    		<option value="1" <?php if ($_GET['hp_status'] == '1'): ?>selected<?php endif; ?> >伙拼中</option>
	                    		<option value="2" <?php if ($_GET['hp_status'] == '2'): ?>selected<?php endif; ?> >伙拼中(已成功)</option>
	                    		<option value="3" <?php if ($_GET['hp_status'] == '3'): ?>selected<?php endif; ?> >伙拼结束(已成功)</option>
	                    		<option value="4" <?php if ($_GET['hp_status'] == '4'): ?>selected<?php endif; ?> >伙拼结束(已失败)</option>
	                    		<option value="5" <?php if ($_GET['hp_status'] == '5'): ?>selected<?php endif; ?> >配货中</option>
	                    		<option value="6" <?php if ($_GET['hp_status'] == '6'): ?>selected<?php endif; ?> >已完成</option>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>支付状态</dt>
                            <dd>
                            <select name="order_pay_status" class="w250">
                            <option value="">请选择</option>
                            <option <?php if ($_GET['order_pay_status'] == 2): ?>selected="selected"<?php endif; ?> value="2">已支付</option>
                            <option <?php if ($_GET['order_pay_status'] == 1): ?>selected="selected"<?php endif; ?> value="1">未支付</option>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>支付方式</dt>
                            <dd>
                            <select name="pay" class="w250">
                            <option value="">请选择</option>
                            <?php $_from = $this->_tpl_vars['pay']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
                            <option <?php if ($_GET['pay'] == $this->_tpl_vars['list']['payment_id']): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['list']['payment_id']; ?>
"><?php echo $this->_tpl_vars['list']['payment_name']; ?>
</option>
                            <?php endforeach; endif; unset($_from); ?>
                            </select>
                            </dd>
                        </dl>                      
                        <dl>
                            <dt>订单总额</dt>
                            <dd>
                            <input type="text" class="w118" name="minp" value="<?php echo $_GET['minp']; ?>
" />
                            -
							<input type="text" class="w118" name="maxp" value="<?php echo $_GET['maxp']; ?>
" />
                            </dd>
                        </dl>
                        <dl>
                            <dt>下单时间</dt>
                            <dd>
                            <script language="javascript">
            var cdr = new Calendar("cdr");
            document.write(cdr);
            cdr.showMoreDay = true;
        </script>
                            <input onFocus="cdr.show(this);" class="w118" type="text" name="stime" id="stime" value="<?php echo $_GET['stime']; ?>
"">
                            -
							<input onFocus="cdr.show(this);" class="w118" type="text" name="etime" id="etime" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['etime'])) ? $this->_run_mod_handler('default', true, $_tmp, time()+86399) : smarty_modifier_default($_tmp, time()+86399)))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
"">
                            </dd>
                        </dl>                        
                        <dl>
                            <dt>支付时间</dt>
                            <dd>
                            <script language="javascript">
            var pcdr = new Calendar("pcdr");
            document.write(pcdr);
            pcdr.showMoreDay = true;
        </script>
                            <input onFocus="pcdr.show(this);" class="w118" type="text" name="p_stime" id="p_stime" value="<?php echo $_GET['p_stime']; ?>
"">
                            -
                            <input onFocus="pcdr.show(this);" class="w118" type="text" name="p_etime" id="p_etime" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['p_etime'])) ? $this->_run_mod_handler('default', true, $_tmp, time()+86399) : smarty_modifier_default($_tmp, time()+86399)))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
"">
                            </dd>
                        </dl>                        
                        <dl>
                            <dt>买家名称</dt>
                            <dd><input type="text" class="w250" name="user" value="<?php echo $_GET['user']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>会员ID</dt>
                            <dd><input type="text" class="w250" name="userid" value="<?php echo $_GET['userid']; ?>
" /></dd>
                        </dl>
                    	<input type="submit" value="搜索" />
                        </form>
                        </div>
                    </div>
                </div>
                <a class="refresh" href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&status=<?php echo $_GET['status']; ?>
"></a>
                <div style="float:right">
   	 				<a href="javascript:;" onclick="showSellAmount('<?php echo $this->_tpl_vars['amountCond']; ?>
');">显示总销售额</a>&nbsp;&nbsp;&nbsp;&nbsp;
            	</div>                
	           </td>
	        </tr>
	    </table>
        <table class="table">
        	<thead>
                <tr>
                    <th class="partition" colspan="99">伙拼订单</th>
                </tr>
            </thead>
            <tbody>
                <tr class="header">
                    <th width="100">订单编号</th>
                    <th width="100">会员</th>
                    <th width="100">伙拼名称</th>
                    <th width="100">订单总价</th>
                    <th width="100">伙拼状态</th>
                    <th width="100">支付状态</th>
                    <th width="100">支付方式</th>
                    <th width="100">平台/系统</th>
                    <th width="150">下单时间</th>
                    <th width="50">操作</th>
                </tr>
                <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                <tr>
                    <td style="position:relative;padding-left:32px;"><?php if ($this->_tpl_vars['list']['stock_shop']): ?><i style="background:url(/image/admin/<?php echo $this->_tpl_vars['list']['stock_shop']; ?>
.png);display: block;height: 32px;left: 0;top:50%; margin-top:-16px;position: absolute;width: 32px;"></i><?php endif; ?><?php echo $this->_tpl_vars['list']['order_id']; ?>
</td>
                    <td>
                    	ID:<?php echo $this->_tpl_vars['list']['member_id']; ?>

                    <br/>
                    	名称:<?php if ($this->_tpl_vars['list']['username']): ?><?php echo $this->_tpl_vars['list']['username']; ?>
<?php else: ?><?php echo $this->_tpl_vars['list']['nick_name']; ?>
(昵称)<?php endif; ?>
                    </td>
                    <td><?php echo $this->_tpl_vars['list']['hp_title']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['list']['total_price']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['list']['hpStatusStr']; ?>
</td>
                    <td>
                    	<?php if ($this->_tpl_vars['list']['payment_status'] == 1): ?>
                    	未支付
                    	<?php else: ?>
                    	(<?php echo $this->_tpl_vars['list']['pay_time']; ?>
)
                    	<br/>已支付
                    	<?php endif; ?>
                    </td>
                    <td><?php echo $this->_tpl_vars['list']['payment_name']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['list']['client_platform_str']; ?>
/<?php echo $this->_tpl_vars['list']['client_system_str']; ?>
</td>
                    <td><?php echo ((is_array($_tmp=$this->_tpl_vars['list']['order_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
</td>
                    <td>
                    <a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&operation=edit&editid=<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['editimg']; ?>
</a>
                    <?php if ($this->_tpl_vars['list']['payment_status'] == 1 && $this->_tpl_vars['list']['status'] == 1): ?>
                    &nbsp;&nbsp;<a class="a-opear" data-type="pay" data-param="{'order_id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="javascript:;">付款</a>
                    <!-- <a class="a-opear" data-type="cancel" data-param="{'order_id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="javascript:;">取消</a> -->
                    <?php endif; ?>
                    </td>
                </tr>
                <?php endforeach; else: ?>
                <tr>
                    <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
                </tr>
                <?php endif; unset($_from); ?>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="99">
                    	<div class="fl">每页最多显示： <?php echo $this->_tpl_vars['de']['perPageRows']; ?>
条</div>
                    	<div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
</div>
                    	<div class="fr">共有<?php echo $this->_tpl_vars['de']['count']; ?>
条记录</div>
                    </td>
                </tr>
            </tfoot>
        </table>
        <?php endif; ?>
    </div>
</body>
</html>